from django.db import models


# Create your models here.


class DfeDatabase(models.Model):
    database_id = models.AutoField(primary_key=True)
    project_id = models.IntegerField()
    database_type = models.IntegerField()
    database_name = models.CharField(max_length=64)
    other_info = models.CharField(max_length=100, blank=True, null=True)
    create_time = models.DateTimeField()
    creator_id = models.IntegerField()
    update_time = models.DateTimeField()
    project_name = models.CharField(max_length=40)

    class Meta:
        managed = False
        db_table = 'dfe_database'


class DfeProject(models.Model):
    project_id = models.BigIntegerField(primary_key=True)
    project_number = models.IntegerField()
    project_name = models.CharField(max_length=25)
    project_description = models.CharField(max_length=100)
    createor_name = models.CharField(max_length=64)
    create_time = models.DateTimeField()
    creator_id = models.IntegerField()
    update_time = models.DateTimeField(blank=True, null=True)
    update_name = models.CharField(max_length=11, blank=True, null=True)
    project_manager = models.CharField(max_length=64, blank=True, null=True)
    project_manager_id = models.IntegerField(blank=True, null=True)
    project_status = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'dfe_project'


class DfeTable(models.Model):
    table_id = models.AutoField(primary_key=True)
    file_id = models.IntegerField()
    project_id = models.IntegerField()
    project_name = models.CharField(max_length=64)
    database_id = models.IntegerField()
    database_name = models.CharField(max_length=64)
    create_type = models.IntegerField()
    table_name = models.CharField(max_length=64)
    other_info = models.CharField(max_length=200, blank=True, null=True)
    creator_id = models.IntegerField(blank=True, null=True)
    create_time = models.DateTimeField(blank=True, null=True)
    update_time = models.DateTimeField(blank=True, null=True)
    manage_id = models.IntegerField(blank=True, null=True)
    manage_name = models.CharField(max_length=255, blank=True, null=True)
    topic_id = models.IntegerField(blank=True, null=True)
    topic_name = models.CharField(max_length=64, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'dfe_table'


class DfeTopic(models.Model):
    topic_id = models.AutoField(primary_key=True)
    project_id = models.IntegerField()
    project_name = models.CharField(max_length=64)
    topic_code = models.IntegerField()
    topic_name = models.CharField(max_length=64)
    partition_number = models.IntegerField()
    other_info = models.CharField(max_length=100, blank=True, null=True)
    create_time = models.DateTimeField()
    update_time = models.DateTimeField()
    creator_id = models.IntegerField()
    copy_number = models.IntegerField()
    cluster_id = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'dfe_topic'

